package com.hackordie.daos.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.hackordie.commons.hardware.components.Processor;

public class ProcessorMapper implements RowMapper<Processor> {

	@Override
	public Processor mapRow(final ResultSet result, final int row) throws SQLException {
	    	    
	    Processor processor = new Processor(result.getString("name"), 
	                                     result.getInt("energyTurnOn"),
	                                     result.getInt("speedForCore"),
	                                     result.getInt("cores"),
	                                     100,  //levelSkills, no se almacena en components
	                                     result.getInt("prize"));
	    
	    processor.setIdComponent(result.getInt("idComponent"));
		return processor;
	}

}
